<%@Page Language="VB"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

<script language="JScript">
<!--
function ShowHTMLContent() {
  var strURL = 'http://<% = Request.ServerVariables("SERVER_NAME") %><% = Request.Path %>?<% = Request.QueryString %>';
  var strDisplay = new String;
  var objHTTP = new ActiveXObject("microsoft.XMLHTTP")
  objHTTP.open('GET', strURL, false);
  objHTTP.send();
  var strReply = objHTTP.responseText;
  var intStart = strReply.indexOf('<!' + '--start-->') + 12;
  var intEnd = strReply.indexOf('<!' + '--end-->');
  if ((intStart > 0) && (intEnd > intStart))
    var strDisplay = strReply.substring(intStart, intEnd);
  document.all['outHTML'].innerText = strDisplay + ' ';
}
function SetCheck(strCheckboxName) {
  document.all[strCheckboxName].checked = true;
}
//-->
</script>

<!-- #include file="style.inc" -->
</head>
<body bgcolor="#ffffff" onload="ShowHTMLContent()">
<!--------------------------------------------------------------------------->
<span class="heading">HtmlInputButton Controls</span> &nbsp; &nbsp; &nbsp;

<!--start-->
<input id="MySubmit" type="submit" runat="server" />
<input id="MyReset" type="reset" runat="server" />
<input id="MyButton" type="button" runat="server" Value="My Caption" />
<!--end-->

<p /><div id="outError" runat="server" />
<font face="Courier New" size="2"><div style="background-color:gainsboro; padding-left:10px" id="outHTML">Fetching HTML content...</div></font>

<form runat="server" method="get">
<table border="0">
<tr><td colspan="2"><hr /></td><td align="center">- Submit Button -</td><td colspan="4"><hr /></td></tr>
<tr>
<td nowrap="nowrap"><input type="checkbox" id="chkSDisabled" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Disabled =</td><td nowrap="nowrap"><select id="selSDisabled" size="1" runat="server" onchange="SetCheck('chkSDisabled')"><option>True</option><option>False</option></select></td>
<td nowrap="nowrap">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;</td>
<td nowrap="nowrap"><input type="checkbox" id="chkSName" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Name =</td><td nowrap="nowrap"><input type="text" size="20" id="txtSName" runat="server" onkeypress="SetCheck('chkSName')" /></td><td></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkSValue" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Value =</td><td nowrap="nowrap"><input type="text" size="20" id="txtSValue" runat="server" onkeypress="SetCheck('chkSValue')" /></td><td></td>
<td nowrap="nowrap"><input type="checkbox" id="chkSVisible" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Visible =</td><td nowrap="nowrap"><select id="selSVisible" size="1" runat="server" onchange="SetCheck('chkSVisible')"><option>True</option><option>False</option></select></td>
</tr>
<tr><td colspan="2"><hr /></td><td align="center">- Reset Button -</td><td colspan="4"><hr /></td></tr>
<tr>
<td nowrap="nowrap"><input type="checkbox" id="chkRDisabled" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Disabled =</td><td nowrap="nowrap"><select id="selRDisabled" size="1" runat="server" onchange="SetCheck('chkRDisabled')"><option>True</option><option>False</option></select></td>
<td nowrap="nowrap">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;</td>
<td nowrap="nowrap"><input type="checkbox" id="chkRName" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Name =</td><td nowrap="nowrap"><input type="text" size="20" id="txtRName" runat="server" onkeypress="SetCheck('chkRName')" /></td><td></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkRValue" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Value =</td><td nowrap="nowrap"><input type="text" size="20" id="txtRValue" runat="server" onkeypress="SetCheck('chkRValue')" /></td><td></td>
<td nowrap="nowrap"><input type="checkbox" id="chkRVisible" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Visible =</td><td nowrap="nowrap"><select id="selRVisible" size="1" runat="server" onchange="SetCheck('chkRVisible')"><option>True</option><option>False</option></select></td>
</tr>
<tr><td colspan="2"><hr /></td><td align="center">- Button -</td><td colspan="4"><hr /></td></tr>
<tr>
<td nowrap="nowrap"><input type="checkbox" id="chkBDisabled" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Disabled =</td><td nowrap="nowrap"><select id="selBDisabled" size="1" runat="server" onchange="SetCheck('chkBDisabled')"><option>True</option><option>False</option></select></td>
<td nowrap="nowrap">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  &nbsp;</td>
<td nowrap="nowrap"><input type="checkbox" id="chkBName" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Name =</td><td nowrap="nowrap"><input type="text" size="20" id="txtBName" runat="server" onkeypress="SetCheck('chkBName')" /></td><td></td>
</tr><tr>
<td nowrap="nowrap"><input type="checkbox" id="chkBValue" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Value =</td><td nowrap="nowrap"><input type="text" size="20" id="txtBValue" runat="server" onkeypress="SetCheck('chkBValue')" /></td><td></td>
<td nowrap="nowrap"><input type="checkbox" id="chkBVisible" runat="server" /> Set: &nbsp; </td><td align="right" nowrap="nowrap">Visible =</td><td nowrap="nowrap"><select id="selBVisible" size="1" runat="server" onchange="SetCheck('chkBVisible')"><option>True</option><option>False</option></select></td>
</tr><tr>
<td></td><td></td><td></td><td></td>
<td nowrap="nowrap"><input type="button" Value="Reset" onclick="javascript:location.href='http://<% = Request.ServerVariables("SERVER_NAME") %><% = Request.Path %>'"></td><td nowrap="nowrap"></td><td nowrap="nowrap"><input type="submit" Value="Update" runat="server" /></td>
</tr>
</table>
</form>

<script language="VB" runat="server">
Sub Page_Load()

outError.innerHTML = ""

Try

   If IsPostBack() Then

      If chkSDisabled.Checked Then MySubmit.Disabled = selSDisabled.Value
      If chkSName.Checked Then MySubmit.Name = txtSName.Value
      If chkSValue.Checked Then MySubmit.Value = txtSValue.Value
      If chkSVisible.Checked Then MySubmit.Visible = selSVisible.Value
      If chkRDisabled.Checked Then MyReset.Disabled = selRDisabled.Value
      If chkRName.Checked Then MyReset.Name = txtRName.Value
      If chkRValue.Checked Then MyReset.Value = txtRValue.Value
      If chkRVisible.Checked Then MyReset.Visible = selRVisible.Value
      If chkBDisabled.Checked Then MyButton.Disabled = selBDisabled.Value
      If chkBName.Checked Then MyButton.Name = txtBName.Value
      If chkBValue.Checked Then MyButton.Value = txtBValue.Value
      If chkBVisible.Checked Then MyButton.Visible = selBVisible.Value

   End If

   selSDisabled.Value = MySubmit.Disabled
   txtSName.Value = MySubmit.Name
   txtSValue.Value = MySubmit.Value
   selSVisible.Value = MySubmit.Visible
   selRDisabled.Value = MyReset.Disabled
   txtRName.Value = MyReset.Name
   txtRValue.Value = MyReset.Value
   selRVisible.Value = MyReset.Visible
   selBDisabled.Value = MyButton.Disabled
   txtBName.Value = MyButton.Name
   txtBValue.Value = MyButton.Value
   selBVisible.Value = MyButton.Visible

Catch objError As Exception

   outError.innerHTML = "<b>* Error</b>: " & objError.Message & "<p />"

End Try

End Sub

</script>

<!--------------------------------------------------------------------------->
<!-- #include file="foot.inc" -->
</body>
</html>
